home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / begincpp.zip / #5_VER1.C < prev    next >
C/C++ Source or Header  |  1990-08-05  |  4KB  |  139 lines

  1. #line 1 "#5_ver1.cxx"
  2. void *_new(long);
  3. void _delete(void*);
  4. void *_vec_new(void*,int,int,void*(*)(void*));
  5. void _vec_delete(void*,int,int,void(*)(void*,int),...);
  6. void exit(int);
  7. static void cdecl _STI();
  8. static void cdecl _STD();
  9.  
  10. typedef unsigned int size_t ;
  11. typedef char *va_list ;
  12. struct _iobuf { 
  13. char *__iobuf__ptr ;
  14. int __iobuf__cnt ;
  15. char *__iobuf__base ;
  16. char __iobuf__flag ;
  17. char __iobuf__file ;} ;
  18. extern struct _iobuf _iob [];
  19. int _filbuf (struct _iobuf *);
  20. int _flsbuf (int , struct _iobuf *);
  21. void clearerr (struct _iobuf *);
  22. int fclose (struct _iobuf *);
  23. int fcloseall (void );
  24. struct _iobuf *fdopen (int , char *);
  25. int fflush (struct _iobuf *);
  26. int fgetc (struct _iobuf *);
  27. int fgetchar (void );
  28. int fgetpos (struct _iobuf *, long *);
  29. char *fgets (char *, int , struct _iobuf *);
  30. int flushall (void );
  31. struct _iobuf *fopen (char *, char *);
  32. int fprintf (struct _iobuf *, char *, ... );
  33. int fputc (int , struct _iobuf *);
  34. int fputchar (int );
  35. int fputs (char *, struct _iobuf *);
  36. size_t fread (void *, size_t , size_t , struct _iobuf *);
  37. struct _iobuf *freopen (char *, char *, struct _iobuf *);
  38. int fscanf (struct _iobuf *, char *, ... );
  39. int fsetpos (struct _iobuf *, long *);
  40. int fseek (struct _iobuf *, long , int );
  41. long ftell (struct _iobuf *);
  42. size_t fwrite (void *, size_t , size_t , struct _iobuf *);
  43. char *gets (char *);
  44. int getw (struct _iobuf *);
  45. void perror (char *);
  46. int printf (char *, ... );
  47. int puts (char *);
  48. int putw (int , struct _iobuf *);
  49. int remove (char *);
  50. int rename (char *, char *);
  51. void rewind (struct _iobuf *);
  52. int rmtmp (void );
  53. int scanf (char *, ... );
  54. void setbuf (struct _iobuf *, char *);
  55. int setvbuf (struct _iobuf *, char *, int , size_t );
  56. int sprintf (char *, char *, ... );
  57. int sscanf (char *, char *, ... );
  58. char *tempnam (char *, char *);
  59. struct _iobuf *tmpfile (void );
  60. char *tmpnam (char *);
  61. int ungetc (int , struct _iobuf *);
  62. int unlink (char *);
  63. int vfprintf (struct _iobuf *, char *, va_list );
  64. int vprintf (char *, va_list );
  65. int vsprintf (char *, char *, va_list );
  66.  
  67.  
  68. struct animal { char _dummy; } ;
  69. struct mammal { char _dummy; } ;
  70. struct bird { char _dummy; } ;
  71. struct dog { char _dummy; } ;
  72. struct eagle { char _dummy; } ;
  73.  
  74. void print1 (void );
  75. void print2 (void );
  76. void print3 (void );
  77.  
  78. int main ()
  79.     {     
  80.         print1 ( ) ;
  81.         print2 ( ) ;
  82.         print3 ( ) ;
  83.     }      
  84.     exit ( 0 ); 
  85. }
  86.  
  87. extern void print1 ()
  88.     struct animal *_au1_ap = 0 ;
  89.     struct mammal *_au1_mp = 0 ;
  90.     struct bird   *_au1_bp = 0 ;
  91.     struct dog    *_au1_dp = 0 ;
  92.     struct eagle  *_au1_pp = 0 ;
  93.     _au1_ap = (((struct animal *)_new ( (long )(sizeof (struct animal ))) ));
  94.                 ( printf ( (char *)"%s\n", "animal") , 0 ) ;
  95.     _au1_mp = (((struct mammal *)_new ( (long )(sizeof (struct mammal ))) ));
  96.                 ( printf ( (char *)"%s\n", "mammal") , 0 ) ;
  97.     _au1_bp = (((struct bird *)_new ( (long )(sizeof (struct bird ))) ));
  98.                 ( printf ( (char *)"%s\n", "bird") , 0 ) ;
  99.     _au1_dp = (((struct dog *)_new ( (long )(sizeof (struct dog ))) ));
  100.                 ( printf ( (char *)"%s\n", "dog") , 0 ) ;
  101.     _au1_pp = (((struct eagle *)_new ( (long )(sizeof (struct eagle ))) ));
  102.                 ( printf ( (char *)"%s\n", "eagle") , 0 ) ;
  103.  
  104.     printf ( (char *)"\n") ;
  105.     
  106. extern void print2 ()
  107.     struct animal *_au1_ap = 0 ;
  108.     struct mammal *_au1_mp = 0 ;
  109.  
  110.     _au1_ap = (((struct animal *)_new ( (long )(sizeof (struct animal ))) ));
  111.     ( printf ( (char *)"%s\n", "animal") , 0 ) ;
  112.     ( printf ( (char *)"%s\n", "mammal") , 0 ) ;
  113.  
  114.     _au1_mp = (((struct mammal *)_au1_ap ));
  115.     ( printf ( (char *)"%s\n", "mammal") , 0 ) ;
  116.  
  117.     printf ( (char *)"\n") ;
  118.  
  119.  
  120. extern void print3 ()
  121.     struct animal _au1_a ;
  122.     struct animal *_au1_ap = 0 ;
  123.     struct mammal _au1_m ;
  124.  
  125.     _au1_ap = (& _au1_a );
  126.     ( printf ( (char *)"%s\n", "animal") , 0 ) ;
  127.  
  128.     _au1_ap = (struct animal *)(& _au1_m );
  129.     ( printf ( (char *)"%s\n", "animal") , 0 ) ;
  130.  
  131.     printf ( (char *)"\n") ;
  132.